package fi.pakkanen.yarpg.item;

/**
 * The basic interface for all item that can be found and put into a players
 * inventory.
 * 
 * @author Oliver Michels <oliver.michels@gmx.net>
 * 
 */
public interface Item {

	/**
	 * Check whether the item is in the given state.
	 * 
	 * @param state
	 *            the given state
	 * @return true when it is in the given state, false otherwise
	 */
	public boolean isState(ItemState state);

	/**
	 * Set an item to the given state.
	 * 
	 * Beware that this should only be called by the state itself.
	 * 
	 * @param newState
	 *            the new state
	 * @see ItemState
	 */
	public void setState(ItemState newState);

	/**
	 * Trigger a state change.
	 * 
	 * @return true when the state has been changed, false otherwise
	 */
	public boolean changeState();

	/**
	 * Invoke the item and apply its effects.
	 * 
	 * @return true when it could be invoked, false otherwise
	 */
	public boolean invoke();

	/**
	 * Revert possible effects.
	 * 
	 * @return true when it could be reverted, false otherwise
	 */
	public boolean revert();

	/**
	 * Check whether the item is consumable.
	 * 
	 * @return true when it is consumable, false otherwise
	 */
	public boolean isConsumable();

	/**
	 * Check whether the item is equippable.
	 * 
	 * @return true when it is equippable, false otherwise
	 */
	public boolean isEquippable();

	/**
	 * Check whether the item is triggerable and can be activated.
	 * 
	 * @return true when it is triggerable, false otherwise
	 */
	public boolean isTriggerable();

}
